import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    // 上传的文件列表
    fileList: [],
    // 选择的当前文件
    curFile: null,
    // 文本的原始内容
    curFileText: null,

    headerOrigin: [],
    headerConfig: [],
  },
  mutations: {
    pushFileList(state, paramObj) {
      state.fileList.push(paramObj);
    },
    setCurFile(state, paramObj) {
      state.curFile = paramObj;
    },
    setCurFileText(state, paramObj) {
      state.curFileText = paramObj;
    },

    setHeaderOrigin(state, paramObj) {
      state.headerOrigin = paramObj;
    },
    setHeaderConfig(state, paramObj) {
      state.headerConfig = paramObj;
    },
  },
  actions: {
  },
  modules: {
  }
});
